package com.hyt.it.ogt.kq.common.config;

import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 配置信息
 *
 * @author liuqi
 * @date 2022-05-31
 */
@Component
@RefreshScope
@Getter
public class ConfigManager {
	
	public static final double MAXPRICE = 99999999.99;

	@Value("${address}")
	private String address;

	@Value("${bmglAddress}")
	private String bmglAddress;

	@Value("${bmglDetailAddress}")
	private String bmglDetailAddress;
	
	@Value("${bmreguserpwdprefix:Abc}")
	private String bmreguserpwdprefix;

	@Value("${notify.port}")
	private String port;

	@Value("${notify.ip}")
	private String ip;
	
    @Value("${notify.url}")
    private String refundNotifyUrl;
	
	@Value("${file.nginxPath}")
	private String filePath;

	@Value("${pdfWindowsPath}")
	private String pdfWindowsPath;

	@Value("${pdfLinuxPath}")
	private String pdfLinuxPath;

	@Value("${noImageWindow}")
	private String noImageWindow;

	@Value("${noImageLinux}")
	private String noImageLinux;

	@Value("${fileWindow}")
	private String fileWindow;

	@Value("${fileLinux}")
	private String fileLinux;

	/**
	 * 华为云文件上传目录
	 */
	@Value("${hwcloud.fileuploadpath}")
	private String hwCloudFileDict;

	/**
	 * 华为云文件设置分段上传时的最大并发数
	 */
	@Value("${hwcloud.taskNum}")
	private Integer taskNum;

	/**
	 * 华为云文件设置分段大小
	 */
	@Value("${hwcloud.partSize}")
	private Long partSize;

	/**
	 * 华为云文件设置数据反馈上传进度
	 */
	@Value("${hwcloud.progressInterval}")
	private Long progressInterval;

	/**
	 * 允许文件上传异常次数
	 */
	@Value("${hwcloud.retryNum}")
	private Integer retryNum;

	/**
	 * 文件生成超过指定等待时间
	 */
	@Value("${hwcloud.fileTimeOut:20}")
	private Long fileTimeOut;

	/**
	 * 考务管理员推送考试安排通知最大用户数
	 */
	@Value("${wechat.appMini.pushExamUserNotifyNum}")
	private Integer pushExamUserNotifyNum;
	
	@Value("${tps.sms.auditnopasstemplete}")
	private String auditnopasstemplete;
	
	@Value("${tps.sms.sendauditcase:false}")
    private String sendauditcase;
	
	/**
	 * 
	 */
	@Value("${bmlistexportbase:true}")
    private String bmlistExportBaseInfo;
	
	@Value("${bmlistexporturllink:true}")
    private String bmlistExportUrlLinkInfo;
	
	/**
	 * 报名统计任务结束偏移时间，单位：天
	 */
	@Value("${statistic.offset.number:7}")
	private Long statisticOffsetNumber;

	/**
	 * 文件生成超过指定等待时间
	 */
	@Value("${file.kwbdbmfileTimeOut:2}")
	private Long kwbdbmfileTimeOut;
	
	

    @Value("${mq.direct}")
    private String direct;

    @Value("${mq.groupregistration.queue}")
    private String groupRegistrationQueue;

    @Value("${mq.groupregistration.route}")
    private String groupRegistrationRoute;

    /**
     * 报名项目数据统计队列
     */
    @Value("${mq.projectStatistic.queue}")
    private String projectStatisticQueue;

    /**
     * 报名项目数据统计路由
     */
    @Value("${mq.projectStatistic.route}")
    private String projectStatisticRoute;

    /**
     * 短信发送
     */
    @Value("${mq.sendMessage.route}")
    private String sendMessage;
    
    /**
     * 批量保存size
     */
    @Value("${executor.max.batchSaveSize:1000}")
    private Integer batchSaveSize;

    @Value("#{'${paper.password}'.split(',')}")
    private List<String> paperPasswords;

    @Value("${file.nginxPath}")
    private String nginxPath;

    @Value("${file.bmPicPath}")
    private String bmPicPath;

    @Value("${office.defaultOfficeCode}")
    private String defaultOfficeCode;

    @Value("${examination.examinationURL}")
    private String examinationUrl;

    @Value("${examination.glURL}")
    private String glURL;

    @Value("${examAgreement.fileMaxSize}")
    private Long examAgreementFileMaxSize;

    @Value("${temp.baseDataPackage}")
    private String baseDataPackageTemp;

    @Value("${temp.deleteTempDir}")
    private Boolean isDeleteTempDir;

    @Value("${temp.agreement}")
    private String agreementTemp;

    @Value("${temp.placeData}")
    private String placeData;

    @Value("${temp.admissionTicketPdf}")
    private String admissionTicketPdfTemp;

    @Value("${password.obtBaseDataPackage}")
    private String obtBaseDataPackagePassword;

    @Value("${password.gceBaseDataPackage}")
    private String gceBaseDataPackagePassword;

    @Value("${password.placeDataPassword}")
    private String placeDataPassword;

    @Value("${password.gceRoomDataPackage}")
    private String gceRoomDataPackagePassword;

    @Value("${cloudStorage.cloudRootPath}")
    private String cloudRootPath;

    @Value("${cloudStorage.resultPath}")
    private String resultPath;

    @Value("${cloudStorage.candidatePhotoPath}")
    private String candidatePhotoPath;

    @Value("${cloudStorage.monitorBackupPath}")
    private String monitorBackupPath;

    @Value("${cloudStorage.testInventoryPath}")
    private String testInventoryPath;

    @Value("${cloudStorage.ticketTemplatePath}")
    private String ticketTemplatePath;

    @Value("${cloudStorage.templatePath}")
    private String templatePath;

    @Value("${cloudStorage.systemTemplatePath}")
    private String systemTemplatePath;

    @Value("${cloudStorage.officeTemplatePath}")
    private String officeTemplatePath;

    @Value("${huaweiCloudObs.path}")
    private String huaweiCloudObsPath;

    @Value("${executor.maxPoolSize}")
    private int executorMaxPoolSize;

    @Value("${temp.dbf}")
    private String dbfRoot;

    @Value("${uploadFile.agreement.size}")
    private Long agreementUploadFileSize;

    @Value("#{'${uploadFile.agreement.format}'.split(',')}")
    private List<String> agreementUploadFileFormat;

    @Value("${uploadFile.candidate.minSize}")
    private float candidateImportMinSize;

    @Value("${uploadFile.candidate.maxSize}")
    private float candidateImportMaxSize;

    @Value("${uploadFile.candidate.format}")
    private String candidateImportFormat;

    @Value("${weChat.arrangedNotification.batchSize}")
    private Long arrangedNotificationBatchSize;

    @Value("${onlineExam.examUrl}")
    private String onlineExamUrl;

    /**
     * 导入考生照片zip包大小 MB
     */
    @Value("${admission.ticket.examinees.headPhotoFileMaxSize}")
    private long headPhotoFileMaxSize;

    @Value("${bm.max.pageSize:5000}")
    private Integer bmMaxPageSize;
    @Value("${executor.max.candidate:100}")
    private Integer executorMaxSize;

    /**
     * 转换成byte长度
     *
     * @return
     */
    public long getHeadPhotoFileMaxSizeToByte() {
        return headPhotoFileMaxSize * 1024 * 1024;
    }

    @Value("${redis.datainvalidtime:300}")
    private Integer redisDataInvalidTime;

    /**
     * 准考证默认照片
     */
    @Value("${admission.defaultCertificatePhoto:https://obs-ogt.obs.cn-east-3.myhuaweicloud.com:443/tinymce/1675325390599-blobid0.png}")
    private String defaultCertificatePhoto;

    @Value("${cloudStorage.candidatePhotobatchsize:200}")
    private Integer candidatePhotobatchsize;

    /**
     * 报名考生主列表查询sql分支配置,截止日期
     */
    @Value("${bm.page.date:'2023-10-31'}")
    private String bmPageSearchDate;

    @Value("${zjw.selectExamAppkey}")
    private String zjwSelectExamAppkey;

    @Value("${zjw.selectKWAPAppKey}")
    private String zjwSelectKWAPAppKey;

    @Value("${zjw.selectExamStudentAppKey}")
    private String zjwSelectExamStudentAppKey;

    @Value("${zjw.insertExamStudentScoreAppKey}")
    private String zjwInsertExamStudentScoreAppKey;

    @Value("${zjw.sid}")
    private String zjwSid;

    @Value("${zjw.userKey}")
    private String zjwUserKey;

    @Value("${zjw.requestUrl}")
    private String zjwRequestUrl;

    @Value("${sign.templatePath}")
    private String signPath;

    @Value("${sendMessage.officeId}")
    private String officeId;

    @Value("${sendMessage.lockTime:30}")
    private Integer sendMessageLockTime;

    @Value("${sendMessage.sendMessageTotalPerMinute:50000}")
    private Integer sendMessageTotalPerMinute;

}
